/*

Proposal title: How Whites React to Demographic Change: Millenials, Contact, and Identity

Prefatory notes:

- Proposal has specific hypotheses indicated in text with bullet points.

- This proposal could be interpreted as having > 100 testable if all combinations
	considered individually.  To contain the number of testable claims:
	
	- Two different measures of interethnic contact are posed.  These are
	added together and treated as a 3-valued "continuous" measure.
	
	- Two different measures of white identity are posed.  These
	are added together and treated as a single "continuous" measure.
	
	- Feeling thermometer measures, whose analysis is not explained, are
	operationalized as value for whites minus average value for blacks/latinos/asians.

	- Two different measures of anti immigrant policy are posed.  These
	are added together and treated as a single "continuous" measure.	
	
- This proposal has one treatment group and one control group, and will use
"treatment effect" when stating hypothesis below to describe the difference
between the treatment and control group on variable.


Stated-Hyp-1 : "white Millennials are more likely than older whites to 
	report interethnic contact"
	
	(Note: these are non-experimental hypotheses)
	
	Test-Hyp-1 : Among whites, millenials will have gone to more racially
	integrated high schools.
	
	Test-Hyp-2 : Among whites, millenials will be more likely to report
	inter-ethnic contact
	

Stated-Hyp-2 : "whites with lower levels of interethnic contact are affected 
	by the treatment more than whites with higher levels of interethnic contact"
	
	** Test-Hyp-3-9 all have form "Among whites, the treatment effect on ____ will be 
	higher among those with low interethnic contact."
	
	Test-Hyp-3: increased status threat

	Test-Hyp-4: anti-immigrant policy preference
	
	Test-Hyp-5: support for higher levels of defense spending
	
	Test-Hyp-6: opposition to affirmative action
	
	Test-Hyp-7: opposition to universal health care
	
	Test-Hyp-8: more negative feelings about blacks/latinos/asians vs. whites
		
Stated-Hyp-3 : "differences among white Millennials and older whites in their 
	response to the treatment is driven, in part, by different levels of 
	interethnic contact."

	** These are mediated moderation hypothesis.  There are not different levels
	of interethnic contact (the mediator), nor is there moderation of the
	treatment effect by whether one is a millennial.
	
	** Test-Hyp-11-17 The premise of the stated hypothesis is that the treatment effect on ____ is moderated
	by millenial status.  If that premise is true, raises question of whether it
	is mediated by interethnic contact.
	
	Test-Hyp-9: increased status threat

	Test-Hyp-10: anti-immigrant policy preference
	
	Test-Hyp-11: support for higher levels of defense spending
	
	Test-Hyp-12: opposition to affirmative action
	
	Test-Hyp-13: opposition to universal health care
	
	Test-Hyp-14: more negative feelings about blacks/latinos/asians vs. whites
	
Stated-Hyp-4 : "white Millennials are less likely than other whites to report 
	strong white racial identification;"
	
	Test-Hyp-15: Among Whites, millenials are less likely to report that they
	identify with White identity
	

Stated-Hyp-5 : "whites with stronger racial identification are affected by the 
	treatment more than whites with weaker racial identification;"

	** Test-Hyp-20-26 all have form "Among whites, the treatment effect on ____ will be 
	higher among those with strong racial identification."

	Test-Hyp-16: increased status threat

	Test-Hyp-17: anti-immigrant policy preference
	
	Test-Hyp-18: support for higher levels of defense spending
	
	Test-Hyp-19: opposition to affirmative action
	
	Test-Hyp-20: opposition to universal health care
	
	Test-Hyp-21: more negative feelings about blacks/latinos/asians vs. whites
	
Stated Hyp-6 : "differences among white Millennials and older whites in 
	their response to the treatment is driven, in part, by different levels 
	of white racial identification"

	** SAME PREMISE AS STATED-HYP-3
	
--

Note: Proposal indicates that Millennial is defined as persons born after 1980.

*/

/*****************************************************************************
  MEASURES
*****************************************************************************/	

clear all
use Schildkraut726.dta, clear

* TREATMENT

* experimental treatment

	gen treatment = (XTESS202 == 1) if XTESS202 < .

* OUTCOMES

* intergroup contact measures

	clonevar highschool = Q4 if Q4 != -1
	
	recode Q5 (1=1) (2=0) (*=.), gen(knowanyone)
	
	recode Q6 (1=1) (2=0) (*=.), gen(closefriends)
	
	gen interethnic_contact = 0 if knowanyone == 0
	replace interethnic_contact = 1 if knowanyone == 1 & closefriends == 0
	replace interethnic_contact = 2 if knowanyone == 1 & closefriends == 1
	
* measure of status threat

	/* "racial minorities are likely to reduce the influence of White Americans 
	in society." (1=SA to 7=SD) */

	recode Q10 (-1=.) (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), gen(statusthreat)

* measures of attitudes about immigration	

	/* required amount of time to apply for citizenship (1=increased a lot, 
	5 = decreased a lot) */
	
	recode Q11 (-1=.) (1=5) (2=4) (3=3) (4=2) (5=1), gen(delayimmigration)
	
	/* "number of immigrants from foreign countries who are allowed to come to 
	the U.S. to live" (1=increased a lot, 5 = decreased a lot) */

	recode Q12 (-1=.), gen(fewerimmigrants)

	gen antiimmigrant= delayimmigration + fewerimmigrants
	tab antiimmigrant, mis
	
* defense spending	
	
	/* funding dedicated to funding the US military (1=increased a lot, 
	5 = decreased a lot) */
	
	recode Q13 (-1=.) (1=5) (2=4) (3=3) (4=2) (5=1), gen(moredefensespending)
	
* affirmative action	
	
	recode Q14 (-1=.), gen(antiaffirmativeaction)
	
* universal health care	

	recode Q15 (-1=.), gen(antiuniversalhealthcare)
	
* feeling thermometers

	clonevar therm_blacks = Q16 if Q16 != -1
	
	clonevar therm_latino = Q17 if Q17 != -1

	clonevar therm_asians = Q18 if Q18 != -1

	clonevar therm_whites = Q19 if Q19 != -1

	gen nonwhite_negativity = therm_whites - ((therm_blacks + therm_latino + therm_asians)/3)
	

* MODERATORS	

	* being a "millennial"
	
	/* (Note: These data were collected in 2016 and proposal says millennial
	is defined as born after 1980. Only age is in dataset, not birth year.   
	We are defining millennial as a respondent aged 35 or younger.) */
	
	gen millennial = (PPAGE <= 35)

	
	* white identity
	
	recode Q2 (-1=.) (1=4) (2=3) (3=2) (4=1), gen(whitesharedfate)
	
	recode Q3 (-1=.) (1=5) (2=4) (3=3) (4=2) (5=1), gen(whiteimportance)
	
	* rescaling whitesharedfate to vary from 1-5
	replace whitesharedfate=whitesharedfate/4*5
	
	gen whiteidentity = whiteimportance + whitesharedfate
	sum whiteidentity
	
/*****************************************************************************
  ANALYSES
*****************************************************************************/

	/* (Note: all respondents are White non-Hispanic, will not repeat 
		"Among whites..." below) */

* Test-Hyp-1 : Millenials will have gone to more racially
* 	integrated high schools.
	
	regress highschool i.millennial
	// supported <.000
	tess 1.millennial +, init(Schildkraut726) bonf(3)
	
* Test-Hyp-2 : Millenials will be more likely to report
*	interethnic contact
	
	regress interethnic_contact i.millennial
	// not supported .728
	tess 1.millennial +, bonf(3)

	
	
* Test-Hyp-3-8: Moderation of treatment effect by interethnic contact
* 
	
	* 3 - Status threat
	regress statusthreat i.treatment##c.interethnic_contact
	// not supported .740
	tess 1.treatment#c.interethnic_contact -, bonf(6)
	
	* 4 - Anti-immigrant policy preference
	regress antiimmigrant i.treatment##c.interethnic_contact
	// not supported .563
	tess 1.treatment#c.interethnic_contact -, bonf(6)
	
	* 5 - More defense spending
	regress moredefensespending i.treatment##c.interethnic_contact
	// not supported .514
	tess 1.treatment#c.interethnic_contact -, bonf(6)
	
	* 6 - Anti affirmative action
	regress antiaffirmativeaction i.treatment##c.interethnic_contact
	// not supported .997
	tess 1.treatment#c.interethnic_contact -, bonf(6)
	
	* 7 - Anti universal healthcare
	regress antiuniversalhealthcare i.treatment##c.interethnic_contact
	// not supported .055 -- Checked and CORRECT direction
	tess 1.treatment#c.interethnic_contact -, bonf(6)
	
	* 8 - Negative feelings about nonwhites
	regress nonwhite_negativity i.treatment##c.interethnic_contact
	// not supported .544
	tess 1.treatment#c.interethnic_contact -, bonf(6)	
	
* Test-Hyp-9-14: Moderation of treatment effects by age mediated by interethnic contact
*
* Note: these all fail at the premise of whether there are treatment effects moderated
* by age in the first place.  Doing and listing these p-values below.  

	* 9 - Status threat
	regress statusthreat i.treatment##i.millennial
	// not supported .296
	tess 1.treatment#1.millennial -, bonf(6)
	
	* 10 - Anti-immigrant policy preference
	regress antiimmigrant i.treatment##i.millennial
	// not supported .817
	tess 1.treatment#1.millennial -, bonf(6)
	
	* 11 - More defense spending
	regress moredefensespending i.treatment##i.millennial
	// not supported .727
	tess 1.treatment#1.millennial -, bonf(6)
	
	* 12 - Anti affirmative action
	regress antiaffirmativeaction i.treatment##i.millennial
	// not supported .891
	tess 1.treatment#1.millennial -, bonf(6)
	
	* 13 - Anti universal healthcare
	regress antiuniversalhealthcare i.treatment##i.millennial
	// not supported .848 
	tess 1.treatment#1.millennial -, bonf(6)
	
	* 14 - Negative feelings about nonwhites
	regress nonwhite_negativity i.treatment##i.millennial
	// not supported .916 
	tess 1.treatment#1.millennial -, bonf(6)
	
* Test-Hyp-15: Among Whites, millenials are less likely to report that they
*	identify with White identity

	regress whiteidentity i.millennial
	// supported. p = .005
	tess 1.millennial -, bonf(3)
	
*	Test-Hyp-16-21: Moderation of treatment effect by racial identification
*

	* 16 - Status threat
	regress statusthreat i.treatment##c.whiteidentity
	// not supported .346
	tess 1.treatment#c.whiteidentity +, bonf(6)
	
	* 17 - Anti-immigrant policy preference
	regress antiimmigrant i.treatment##c.whiteidentity
	// not supported .328
	tess 1.treatment#c.whiteidentity +, bonf(6)
	
	* 18 - More defense spending
	regress moredefensespending i.treatment##c.whiteidentity
	// not supported .222
	tess 1.treatment#c.whiteidentity +, bonf(6)
	
	* 19 - Anti affirmative action
	regress antiaffirmativeaction i.treatment##c.whiteidentity
	// not supported .496
	tess 1.treatment#c.whiteidentity +, bonf(6)
	
	* 20 - Anti universal healthcare
	regress antiuniversalhealthcare i.treatment##c.whiteidentity
	// not supported .707
	tess 1.treatment#c.whiteidentity +, bonf(6)
	
	* 21 - Negative feelings about nonwhites
	regress nonwhite_negativity i.treatment##c.whiteidentity
	// not supported .327
	tess 1.treatment#c.whiteidentity +, bonf(6)	
	
